package com.example.demo.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * 用来实现页面跳转的一个controller
 */
@Controller
public class PageController {


    @RequestMapping("index")
    public String getIndex(){
        return "index";
    }


    @RequestMapping("/loginIndex")
    public String getLoginIndex(){
        return "loginIndex";
    }


    @RequestMapping("/lookAllStudent")
    public String lookAllStudent(){
        return "lookAllStudent";
    }


    @RequestMapping("/addStudent")
    public String addStudent(){
        return "addStudent";
    }


    @RequestMapping("/show")
    public String show(){
        return "reshow";
    }

    @RequestMapping("/deleteStudent")
    public String deleteStudent(){
        return "deleteStudent";
    }
    @RequestMapping("/deleteUser")
    public String deleteUser(HttpSession session){
        session.setAttribute("user",null);
        return "index";
    }
}
